﻿using System;

namespace PSE.Updater.Client.Engine
{
    public class SystemInformation
    {
        public string SystemName { get; private set; }
        public int MajorVersion { get; private set; }
        public string Path { get; set; }
        private SystemDetails _cache = null;

        public SystemDetails SystemDetails
        {
            get
            {
                if(_cache == null)
                    _cache = new SystemDetails(this.SystemName, this.MajorVersion, true, this.Path);

                return _cache;
            }
        }

        public SystemInformation(string systemName, int majorVersion, string path)
        {
            if (string.IsNullOrEmpty(systemName))
                throw new ArgumentNullException("systemName");

            if (majorVersion <=0 )
                throw new Exception("Invalid Major Version");

            if(string.IsNullOrEmpty(path))
                throw new ArgumentNullException("path");

            this.SystemName = systemName;
            this.MajorVersion = majorVersion;
            this.Path = path;
        }
    }
}
